<?php

class MedcoCActiveRecord extends CActiveRecord{
	
	public function beforeSave() {
		if ($this->isNewRecord){
			$this->createdTime = new CDbExpression('NOW()');
			$this->createdBy = Yii::app()->user->id;
		}
	
		$this->updatedTime = new CDbExpression('NOW()');
		$this->updatedBy = Yii::app()->user->id;
	
		return parent::beforeSave();
	}
	

}

?>